<?php /* Smarty version 2.6.26, created on 2010-10-06 16:39:04
         compiled from index.tpl */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
    <title>ushop on facebook</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    
    <link href="<?php echo $this->_tpl_vars['DIR_WS_CATALOG']; ?>
facebook/facebook.css" type="text/css" rel="Stylesheet" />
</head>
<body>
<?php unset($this->_sections['p_fb']);
$this->_sections['p_fb']['name'] = 'p_fb';
$this->_sections['p_fb']['loop'] = is_array($_loop=$this->_tpl_vars['result_fb']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['p_fb']['show'] = true;
$this->_sections['p_fb']['max'] = $this->_sections['p_fb']['loop'];
$this->_sections['p_fb']['step'] = 1;
$this->_sections['p_fb']['start'] = $this->_sections['p_fb']['step'] > 0 ? 0 : $this->_sections['p_fb']['loop']-1;
if ($this->_sections['p_fb']['show']) {
    $this->_sections['p_fb']['total'] = $this->_sections['p_fb']['loop'];
    if ($this->_sections['p_fb']['total'] == 0)
        $this->_sections['p_fb']['show'] = false;
} else
    $this->_sections['p_fb']['total'] = 0;
if ($this->_sections['p_fb']['show']):

            for ($this->_sections['p_fb']['index'] = $this->_sections['p_fb']['start'], $this->_sections['p_fb']['iteration'] = 1;
                 $this->_sections['p_fb']['iteration'] <= $this->_sections['p_fb']['total'];
                 $this->_sections['p_fb']['index'] += $this->_sections['p_fb']['step'], $this->_sections['p_fb']['iteration']++):
$this->_sections['p_fb']['rownum'] = $this->_sections['p_fb']['iteration'];
$this->_sections['p_fb']['index_prev'] = $this->_sections['p_fb']['index'] - $this->_sections['p_fb']['step'];
$this->_sections['p_fb']['index_next'] = $this->_sections['p_fb']['index'] + $this->_sections['p_fb']['step'];
$this->_sections['p_fb']['first']      = ($this->_sections['p_fb']['iteration'] == 1);
$this->_sections['p_fb']['last']       = ($this->_sections['p_fb']['iteration'] == $this->_sections['p_fb']['total']);
?>
    <?php if ($this->_tpl_vars['result_fb'][$this->_sections['p_fb']['index']]['fb_enable'] == '1'): ?>
        <?php unset($this->_sections['p']);
$this->_sections['p']['name'] = 'p';
$this->_sections['p']['loop'] = is_array($_loop=$this->_tpl_vars['result']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['p']['show'] = true;
$this->_sections['p']['max'] = $this->_sections['p']['loop'];
$this->_sections['p']['step'] = 1;
$this->_sections['p']['start'] = $this->_sections['p']['step'] > 0 ? 0 : $this->_sections['p']['loop']-1;
if ($this->_sections['p']['show']) {
    $this->_sections['p']['total'] = $this->_sections['p']['loop'];
    if ($this->_sections['p']['total'] == 0)
        $this->_sections['p']['show'] = false;
} else
    $this->_sections['p']['total'] = 0;
if ($this->_sections['p']['show']):

            for ($this->_sections['p']['index'] = $this->_sections['p']['start'], $this->_sections['p']['iteration'] = 1;
                 $this->_sections['p']['iteration'] <= $this->_sections['p']['total'];
                 $this->_sections['p']['index'] += $this->_sections['p']['step'], $this->_sections['p']['iteration']++):
$this->_sections['p']['rownum'] = $this->_sections['p']['iteration'];
$this->_sections['p']['index_prev'] = $this->_sections['p']['index'] - $this->_sections['p']['step'];
$this->_sections['p']['index_next'] = $this->_sections['p']['index'] + $this->_sections['p']['step'];
$this->_sections['p']['first']      = ($this->_sections['p']['iteration'] == 1);
$this->_sections['p']['last']       = ($this->_sections['p']['iteration'] == $this->_sections['p']['total']);
?>
            <div class="product">
                <div class="product-thumb">
                    <img src="<?php echo $this->_tpl_vars['DIR_WS_CATALOG']; ?>
images/<?php echo $this->_tpl_vars['result'][$this->_sections['p']['index']]['proImage']; ?>
" />
                </div>
                <div class="product-tit">
                    <a href="<?php echo $this->_tpl_vars['DIR_WS_CATALOG']; ?>
product_info.php?products_id=<?php echo $this->_tpl_vars['result'][$this->_sections['p']['index']]['proID']; ?>
">
                        <?php echo $this->_tpl_vars['result'][$this->_sections['p']['index']]['proName']; ?>

                    </a>
                </div>
                <div class="product-price">
                    <?php echo $this->_tpl_vars['result'][$this->_sections['p']['index']]['proPrice']; ?>
               
                </div>            
                <div class="product-des">
                    <?php echo $this->_tpl_vars['result'][$this->_sections['p']['index']]['proDes']; ?>

                </div>
                <div class="facebook-fan">
                    <fb:like href="<?php echo $this->_tpl_vars['DIR_WS_CATALOG']; ?>
product_info.php?products_id=<?php echo $this->_tpl_vars['result'][$this->_sections['p']['index']]['proID']; ?>
"></fb:like>
                </div>
                <div class="facebook-share">
                    <fb:share-button class="url" type="button_count" href="<?php echo $this->_tpl_vars['DIR_WS_CATALOG']; ?>
product_info.php?products_id=<?php echo $this->_tpl_vars['result'][$this->_sections['p']['index']]['proID']; ?>
"></fb:share-button>
                </div>                     
            </div>    
        <?php endfor; endif; ?>
    <?php else: ?>
        <div>Tính năng ushop trên Facebook chưa được kích hoạt</div>
    <?php endif; ?>

<!-- Cai dat XFBML -->
<div id="fb-root"></div>
<script>
<?php echo '
  window.fbAsyncInit = function() {
    FB.init({appId: \''; ?>
<?php echo $this->_tpl_vars['result_fb'][$this->_sections['p_fb']['index']]['api']; ?>
<?php echo '\', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement(\'script\'); e.async = true;
    e.src = document.location.protocol + \'//connect.facebook.net/en_US/all.js\';
    document.getElementById(\'fb-root\').appendChild(e);
  }());
'; ?>

</script>
<!-- Ket thuc cai dat XFBML -->

<?php endfor; endif; ?>
</body>
</html>